package com.yan.iterator;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * @author taoge
 * @Date 2024/8/1 9:40
 * @Description
 */
public class IteratorDemo1 {
    public static void main(String[] args) {
        ArrayList list = new ArrayList();
        list.add(3);
        list.add(4);
        list.add(5);
        list.add(2);


        Iterator iterator = list.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
